class AIFactory:
    """AI工具工厂类（增强版）"""

    def __init__(self):
        self.config = AIConfig()
        self.dh_config = DigitalHumanConfig()  # 新增数字人配置
        self.proxy = ModelProxy(self.config)
        self.image_gen = ImageGenerator(self.config)
        self.video_model = VideoModel(self.config)
        self.voice_model = VoiceModel(self.config)
        self.dh_generator = DigitalHumanGenerator(self.dh_config)  # 新增数字人生成器
        self.dh_scene = DigitalHumanScene(self.dh_generator)  # 新增场景管理

    def create_digital_human(self,
                             text: str,
                             provider: str = "sadtalker",
                             **kwargs) -> Dict:
        """创建数字人视频"""
        return self.dh_generator.create_talking_head(
            text=text,
            provider=provider,
            **kwargs
        )

    def create_scene_video(self,
                           scene_type: str,
                           script: str,
                           **kwargs) -> Dict:
        """创建场景数字人视频"""
        return self.dh_scene.create_scene_video(scene_type, script, kwargs)

    def check_dh_status(self, provider: str, task_id: str) -> Dict:
        """检查数字人任务状态"""
        return self.dh_generator.check_video_status(provider, task_id)